package com.ecar.api.service.temp.impl;

import java.util.HashMap;
import java.util.Map;

import org.apache.ibatis.executor.ReuseExecutor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ecar.api.service.driver.DriverService;
import com.ecar.api.service.temp.TempService;
import com.ecar.api.support.util.DateUtil;
import com.ecar.api.support.util.Props;
import com.ecar.api.support.util.TempHttpUtil;
import com.ecar.common.util.JSONUtil;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

import com.ecar.core.driver.dao.CarMapper;
import com.ecar.core.driver.entity.Car;
import com.ecar.core.driver.entity.Driver;

@Service
@Transactional
public class TempServiceImpl implements TempService {

	@Autowired
	DriverService driverService;

	@Autowired
	CarMapper carMapper;

	/**
	 * 28驾驶员信誉信息
	 * 
	 * @author fire
	 */
	@Override
	public void rateDriver(String driverId) {

		Driver driver = driverService.selectByPrimaryKey(driverId);

		String url = "/rated/driver";
		Map<String, Object> map = new HashMap<String, Object>();
		String companyId = Props.getValue("ecar.companyId");
		map.put("CompanyId", companyId);
		map.put("LicenseId", driver==null?"111111":driver.getLicenseId());
		map.put("Level", driver.getRates());
		map.put("TestDate", Long.parseLong(DateUtil.getCurDateYYYYMMDD()));
		map.put("TestDepartment", "服务质量信誉考核机构");

		int i=TempHttpUtil.sendPost_JSON(url, map, "ratedDriver");
		System.out.println("发送 28.!!!!!!!!!!!!!"+i);
	}

	/**
	 * 9.网约车车辆里程信息
	 * 
	 * @author txp
	 */
	@Override
	public void postBaseInfoVehicleTotalMile() {

		String url = "/baseinfo/vehicletotalmile";
		JSONArray array = new JSONArray();
		String companyId = Props.getValue("ecar.companyId");
		int address = 420112;
		// 总共二十一条数据
		String info = "鄂A1Q1S3#78,鄂A5PG57#75,鄂A17W9Q#74,鄂A9XU17#76,鄂A1P5R0#82,鄂A1Q3S9#79,鄂A5P0B9#83,鄂A5RB53#81,鄂A5XB52#70,鄂A7Q1B7#73,鄂A7P5J9#77,鄂A8VM61#88,鄂A9P2K2#80,鄂A9P8K6#87,鄂A15W9G#85,鄂A50W1E#81,鄂A71R2N#78,鄂A79W7C#74,鄂A83W9Y#72,鄂A7Q0Z3#89";
		String[] arr = info.split(",");
		int pk=0;
		for (int i = 0; i < 20; i++) {
			pk++;

			JSONObject baseInfoVehicleTotalMile = new JSONObject();
			baseInfoVehicleTotalMile.put("CompanyId", companyId);
			baseInfoVehicleTotalMile.put("Address", address);
			baseInfoVehicleTotalMile.put("VehicleNo", arr[i].split("#")[0]);
			baseInfoVehicleTotalMile.put("TotalMile", Integer.parseInt(arr[i].split("#")[1]));
			baseInfoVehicleTotalMile.put("Flag", 1);
			baseInfoVehicleTotalMile.put("UpdateTime", Long.parseLong(DateUtil.getCurDateTime1()));
			array.add(baseInfoVehicleTotalMile);
		}
		int result = TempHttpUtil.sendPost_JSON(url, array, "baseInfoVehicleTotalMile");

		if (200 == result||201==result) {
			System.out.println("第9条共推送"+pk+"条数据");
			System.out.println("发送 9.网约车车辆里程信息成功!!!!!!!!!!!!!"+result);
		} else {
			System.out.println("发送 9.网约车车辆里程信息失败!!!!!!!!!!!!!"+result);
		}
	}

	/**
	 * 10.驾驶员基本信息
	 * 
	 * @author txp
	 */
	@Override
	public void postBaseInfoDriver() {

		String url = "/baseinfo/driver";

		JSONArray array = new JSONArray();
		String companyId = Props.getValue("ecar.companyId");
		int address = 420107;
		// 总共二十一条数据
		String info = 
				"鄂A0WB08,舒鹏,13554187363,01,19860413,白玉山群居新苑2-1-804,420107198604133715,20090123,20150123,20250123,0,11111,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20171204,20201203"+
						"#鄂A0P0Z7,韩琪乐,13907192899,01,19800908,硚口韩家墩32号,420104198009080410,19990329,20160329,20220329,0,11112,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20171204,20201203"+
						"#鄂A1Q1S3,于歌扬,15392948977,01,19770718,解放公园路83号1-2801,420104197707182014,19960322,20120322,20180322,0,11113,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20171204,20201203" +
						"#鄂A7PD89,万鑫,18140552017,01,19860905,百姓之春10-1-802,420104198609050418,20120712,20120712,20180712,0,11114,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20171204,20201203" +
						"#鄂A5PG57,邓轩,13307193884,01,19870910,紫润明园南区1栋1单元402,420100198709101715,20110308,20170308,20270308,0,420100198709101715,武汉市客运出租汽车管理处,20170511,20170511,20170511,20230511,20180125,湖北华夏创业管理顾问有限公司,20171204,20201203" +
						"#鄂A5PM67,杨哲,18971421690,01,19890530,常展里293号,420103198905305730,20111019,20171019,20271019,1,420103198905305730,武汉市客运出租汽车管理处,20170601,20170601,20170601,20230601,20180125,湖北华夏创业管理顾问有限公司,20171204,20201203" +
						"#鄂A0WE33,朱磊,17671617191,01,19860731,玉龙路水仙里326,420104198607310431,20130725,20130725,20190725,0,11111,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20171204,20201203" +
						"#鄂A17W9Q,黄钰涛,13307196884,01,19750525,青年路392号2楼1号,420103197505254917,19960517,20120517,20220517,0,11112,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20171204,20201203" +
						"#鄂A9XU17,尤勇,13307194936,01,19741025,江岸区中山大道739号12栋,420102197410250618,20000811,20120811,20220811,0,420102197410250618,武汉市客运出租汽车管理处,20170511,20170511,20170511,20230511,20180125,湖北华夏创业管理顾问有限公司,20171204,20201203" +
						"#鄂A3N5M7,吴铭杰,13407139337,01,19760503,汉阳长航新村176-201,42010519760503085x,20040114,20160114,20260114,0,111,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20171204,20201203" +
						"#鄂A5RB53,关爱明,15392889070,01,19691015,汉阳汉南三村221号,420923196910150630,20010409,20130409,20190409,0,111,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20171204,20201203" +
						"#鄂A9Q2A1,裘飞,13971232932,01,19800905,东西湖碧海花园碧波苑1-3-602,420104198009050035,20011119,20131119,20231119,0,111,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20171204,20201203" +
						"#鄂A50W1E,李云,18071040686,01,19710408,江岸球场巷12-2号7楼2号,420102197104080614,20020813,20140813,20240813,0,111,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20171204,20201203" +
						"#鄂A99W3F,胡松,13469986406,01,19861119,武昌余家头201号,420116198611196673,20100601,20160601,20260601,0,111,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20171204,20201203" +
						"#鄂A1Q3S9,刘小军,15377091922,01,19770520,江岸球场路16号-1-8-3,420703197705200019,19991221,20111221,20211221,0,111,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20171204,20201203" +
						"#鄂A11X0B,周鹏,13871049555,01,19820114,光谷青年城12-1-1804,42011119820114051x,20131204,20131204,20191204,0,111,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20171204,20201203" +
						"#鄂A5XB52,张毅,18702740899,01,19710501,江岸解放大道2731-2号7楼4号,420102197105014010,19960329,20120329,20220329,0,111,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20171204,20201203" +
						"#鄂A61W0Q,蒋学敏,18502732302,01,19790803,青山七星天兴花园2-2-101,420107197908030518,20090410,20150410,20250410,0,111,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20171204,20201203" +
						"#鄂A83W9Y,唐钢,15871387110,01,19640815,汉阳大道53号3楼13号,420105196408150057,20050531,20110531,20210531,0,111,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20171204,20201203" +
						"#鄂A9UM13,李亮,15608648522,01,19780824,青山中建开元公馆3-1-1103,420107197808244113,19990805,20110805,20210805,1,111,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20171204,20201203"+
						"#鄂A96X0B,蔡小虎,18008624216,01,19861117,硚口多福巷25号,420104198611173313,20100827,20160827,20260827,0,111,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20171204,20201203"+
						"#鄂A73Q1S,余洋,13659802361,01,19910316,汉阳琴断岭88号1-1-1-1,420984199103165314,20090624,20150624,20250624,1,420984199103165314,武汉市客运出租汽车管理处,20171010,20171010,20171010,20231010,20180125,湖北华夏创业管理顾问有限公司,20171204,20201203"
						+"#鄂A71R2N,徐勖,15527607724,01,19891203,江岸三眼桥四村244号5楼4号,420102198912031735,20110621,20170621,20270621,0,111,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20171204,20201203"
						+"#鄂A1P5R0,王俊,18627171170,01,19831228,硚口汉正街268号3-5-2,420104198312282496,20021228,20151228,20251228,0,112,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20171204,20201203"
						+"#鄂A9P8K6,祝碧凯,18995648581,01,19860924,江汉福星华府2-2203,420103198609245315,20080709,20140709,20240709,0,113,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20171204,20201203"
						+"#鄂A0Q7J0,肖俊,18507118624,01,19900624,江汉八古新墩99号3楼3号,420103199006244959,20110224,20170224,20230224,0,114,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20171204,20201203"
						+"#鄂A7P5J9,张勇,18154404465,01,19681021,江汉区维善里28号8楼3号,420104196810213654,19951006,20111006,20211006,0,115,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20171204,20201203"
						+"#鄂A79W7C,黄易,15327285911,01,19710126,硚口解放大道809-4-6-2,420104197101261236,20010621,20010621,20010621,0,116,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20171204,20201203"
						+"#鄂A7Q1B7,王力,15871826327,01,19900426,黄陂颐景康城5-2-1501,421122199004264219,20090621,20150621,20250621,0,117,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20171204,20201203"
						+"#鄂A9P2K2,陆凯,13377898917,01,19791106,友谊大道恒庆花园1栋2单元16-1605,420107197911060515,20030522,20150522,20250522,0,118,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20171204,20201203"
						+"#鄂A7Q0M1,魏巍,15527771861,01,19850524,江岸安居路180号102栋1-10-1,420102198505241719,20030731,20150731,20250731,0,119,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20171204,20201203"
						+"#鄂A9RY20,刘靖,18171387774,01,19920208,青山钢花村112街58门23号,420111199202083718,20140430,20140430,20200430,0,120,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20171204,20201203"
						+"#鄂A76W5C,杜斌,18827406112,01,19740401,硚口上铁路大厂104号-1号7楼1号,420104197404010039,20020531,20140531,20240531,0,121,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20171204,20201203"
						+"#鄂A5P0B9,汪洋,13207180686,01,19890216,江岸百步亭现代城103-2-903,420117198902163915,20091014,20151014,20251014,0,122,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20171204,20201203"
						+"#鄂A6MN81,张圣,13296641738,01,19920708,武昌列电新村31号13户,420106199207081235,20110728,20170728,20270728,0,123,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20171204,20201203"
						+"#鄂A01X9U,史新玉,18872255115,01,19840115,江岸安居路52号211栋4单元7楼2号,412822198401155879,20100716,20160716,20260716,0,124,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20171204,20201203"
						+"#鄂A6LA97,高巍,18702728519,01,19911010,武昌才茂街江南花园1栋2单元502,42220119911010749x,20120424,20120424,20180424,0,125,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20171204,20201203"
						+"#鄂A15W9G,程智敏,13339997585,01,19870509,东西湖常青花园3区11栋,420117198705095933,20090923,20150923,20250923,0,126,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20171204,20201203"
						+"#鄂A0P3Z9,罗小平,13871124648,01,19630506,硚口天顺园708-1-802,420104196305060431,19890202,20160202,20260202,0,127,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20171204,20201203"
						+"#鄂A8VM61,肖宏杰,15927004494,01,19700320,硚口区仁太里7号,420104197003202419,20120409,20120409,20180409,0,128,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20171204,20201203"
						+"#鄂A5YT75,丁云,15927181332,01,19780215,徐东四期公寓12栋5单元501,420102197802151715,20030721,20150721,20250721,0,129,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20171204,20201203"
						+"#鄂A7BS76,黄利清,15337287909,01,19751211,江汉区电业村601栋27单元1门3号,420123197512117350,20120411,20120411,20180411,0,130,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20171204,20201203"
						+"#鄂A9Q2C3,杨成建,15608636163,01,19730107,保成路2号楼6单元301,422322197301070018,19950120,20160120,20260120,0,131,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20171204,20201203"
						+"#鄂A5Q9T5,邓梦君,13297021083,01,19880208,首义园丁小区6层102号,420106198802080830,20131224,20131224,20191224,0,132,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20171204,20201203"
						+"#鄂A6P1Z9,胡胜军,13554642727,01,19720728,江夏区西港街167号,420122197207280016,20131205,20131205,20191205,0,133,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20171204,20201203"
						+"#鄂A17X9B,胡为,18007142281,01,19760714,武昌区水陆小区32栋8-2号,420106197607140450,20130124,20130124,20190124,0,134,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20171204,20201203"
						+"#鄂A9P0L7,杜斌,15527564588,01,19771205,武昌区世安花园1栋3单元203号,420106197712053690,20121227,20121227,20181227,0,420106197712053690,武汉市客运出租汽车管理处,20170517,20170517,20170517,20230517,20180125,湖北华夏创业管理顾问有限公司,20171204,20201203"
						+"#鄂A0N2U9,刘勇,18696158651,01,19871220,古田四路华生城市广场北区24栋,42010419871220303x,20070522,20130522,20230522,0,111111,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20170127,20200126"
						+"#鄂A53Q1C,林海,15392931046,01,19760929,硚口区古田南村17号4楼2号,420104197609290812,19970625,20150625,20250625,0,111111,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20170127,20200126"
						+"#鄂A78W0Q,李良杰,17607190570,01,19811110,青宜居23栋2单元1304号,420107198111102013,20030623,20150623,20210623,0,111111,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20170127,20200126"
						+"#鄂A13R1P,徐志祥,13554273159,01,19750714,芳草二路49号3栋1单元3楼4号,429004197507140736,19950724,20100724,20200724,0,111111,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20170127,20200126"
						+"#鄂A2P8Q7,王春鹞,13764010659,01,19830126,武泰闸城市花园小区3栋101,420683198301263196,20080125,20140125,20240125,0,111111,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20170127,20200126"
						+"#鄂A36Z2P,熊瑞,15327171711,01,19840812,盘龙城经济开发区F阳光城,420116198408126936,20100928,20160928,20260928,0,111111,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20170127,20200126"
						+"#鄂A50W1G,程明进,15327231220,01,19721215,盘龙城名流人和天地沁和园503-2-502,420105197212152012,20021022,20141022,20241022,0,111111,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20170127,20200126"
						+"#鄂A91X7E,夏兵,13871176918,01,19670922,金银湖马池路丽水佳园A152号,420102196709222019,19960809,20120809,20220809,0,111111,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20170127,20200126"
						+"#鄂A7QP53,陈伯韬,15392939553,01,19790613,芳草苑9栋3单元301,420620197906132033,20030220,20150220,20250220,0,111111,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20170127,20200126"
						+"#鄂A6N3S1,文富华,13871485333,01,19630714,江岸区黑泥湖路383号,420123196307144531,20021202,20141202,20241202,0,111111,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20170127,20200126"
						+"#鄂A1P0T7,黄辉,13407109935,01,19750626,简易路桂苑西村4-1-106,420104197506260418,19970512,20150512,20250512,1,420104197506260418,武汉市客运出租汽车管理处,20171117,20171117,20171117,20231117,20180125,湖北华夏创业管理顾问有限公司,20170127,20200126"
						+"#鄂A06X3M,刘轶,18008659525,01,19900522,洪山区红旗欣居C区12栋1单元1003,422202199005227816,20100727,20160727,20260727,0,111111,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20170127,20200126"
						+"#鄂A13Y1H,盛冕,13377863017,01,19820707,青山区大华铂金郦府1-1701,420107198207070036,20061109,20121109,20221109,0,111111,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20170127,20200126"
						+"#鄂A0Q9V5,任翔宇,15907168969,01,19830426,中北路锦绣中北C栋1单元1102,420106198304268419,20060719,20120719,20220719,0,111112,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20170127,20200126"
						+"#鄂A87X3C,夏新波,18971597731,01,19690826,黄陂区滠阳大街136号,422201196908267712,19940518,20100518,20200518,0,111113,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20170127,20200126"
						+"#鄂A3US07,刘海,18062035400,01,19760510,航空路电业村高层A座2002,420106197605102012,20020827,20140827,20240827,0,111114,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20170127,20200126"
						+"#鄂A7Q0Z3,刘传生,18871463317,01,19680818,武汉经济开发区康宁路68号47栋2单元1楼1号,42092319680818499x,20040317,20160317,20220317,0,111115,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20170127,20200126"
						+"#鄂A8P6D2,彭望中,18986080185,01,19740919,汉阳四新片区鲤跃龙门21栋2601,422202197409196594,20071211,20131211,20231211,0,111116,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20170127,20200126"
						+"#鄂A5JC73,张群林,18971115902,01,19800902,钢花村112街坊30门7号,420107198009024135,20060125,20120125,20220125,0,111117,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20170127,20200126"
						+"#鄂A8P5U1,吴迪,13986252045,01,19840613,友谊南路同乐社区D栋7楼,420104198406130418,20030424,20150424,20210424,0,111118,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20170127,20200126"
						+"#鄂A7RY32,王恒,15072395351,01,19830215,武昌区清风巷24-2-701,42010419830215241x,20130730,20130730,20190730,1,42010419830215241x,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20170127,20200126"
						+"#鄂A5BS90,肖波,13125134413,01,19851223,硚口区常码社区7栋22门,420103198512233211,20080917,20140917,20240917,0,111,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20170127,20200126"
						+"#鄂A7MN92,邹定坤,17720486065,01,19630828, 常青花园一小区,420104196308283614,19950404,20110404,20210404,0,111,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20170127,20200126"
						+"#鄂A37Y2M,尹树望,15629000958,01,19840227,东西湖区金银湖路翠堤春晓24-3-1204,420103198402273239,20020731,20140731,20240731,0,112,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20170127,20200126"
						+"#鄂A5Q1C0,陈峰,18607105875,01,19880809,东西湖区环湖路博大海蓝湾3-2-2701,421022198808093013,20100720,20160720,20260720,0,113,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20170127,20200126"
						+"#鄂A60X7P,赵抑,15927110107,01,19920514,武昌区解放路246-2-5-2号,420106199205141230,20131018,20131018,20191018,0,114,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20170127,20200126"
						+"#鄂A91W3T,丁永鑫,13871295168,01,19840611,江汉区黄陂街43号1栋3单元6楼602,422128198406111711,20040513,20100513,20200513,0,115,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20170127,20200126"
						+"#鄂A5RQ22,邓凯,13720297342,01,19890308,武昌区武泰闸花园小区7栋602,42010619890308163x,20070830,20130830,20230830,0,116,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20170127,20200126"
						+"#鄂A93W5Y,樊勇强,13016488321,01,19771226,武昌南湖南李路首义学院,421083197712265915,20100511,20160511,20260511,0,117,无,00000000,00000001,00000002,00000003,20180125,湖北华夏创业管理顾问有限公司,20170127,20200126";
		String[] arr = info.split("#");
		int pk=0;
		for (int i = 0; i < arr.length; i++) {
			pk++;

			String[] split = arr[i].split(",");
			JSONObject baseInfodriver = new JSONObject();
			baseInfodriver.put("CompanyId", companyId);
			baseInfodriver.put("Address", address);
			baseInfodriver.put("DriverPhone", split[2]);
			baseInfodriver.put("DriverGender", "1");
			baseInfodriver.put("DriverBirthday", Long.parseLong(split[4]));
			baseInfodriver.put("DriverNation", split[3]);
			baseInfodriver.put("DriverContactAddress", split[5]);
			baseInfodriver.put("LicenseId", split[6]);
			baseInfodriver.put("GetDriverLicenseDate",Long.parseLong(split[7]));
			baseInfodriver.put("DriverLicenseOn", Long.parseLong(split[8]));
			baseInfodriver.put("DriverLicenseOff", Long.parseLong(split[9]));
			baseInfodriver.put("TaxiDriver", 1);
			baseInfodriver.put("CertificateNo", split[11]);
			baseInfodriver.put("NetworkCarIssueOrganization", split[12]);
			baseInfodriver.put("NetworkCarIssueDate", Long.parseLong(split[13]));
			baseInfodriver.put("GetNetworkCarProofDate", Long.parseLong(split[14]));
			baseInfodriver.put("NetworkCarProofOn", Long.parseLong(split[15]));
			baseInfodriver.put("NetworkCarProofOff", Long.parseLong(split[16]));
			baseInfodriver.put("RegisterDate", Long.parseLong(split[17]));
			baseInfodriver.put("CommercialType", 1);
			baseInfodriver.put("ContractCompany", split[18]);
			baseInfodriver.put("ContractOn", Long.parseLong(split[19]));
			baseInfodriver.put("ContractOff", Long.parseLong(split[20]));
			baseInfodriver.put("State", 0);
			baseInfodriver.put("Flag", 1);
			baseInfodriver.put("UpdateTime", Long.parseLong(DateUtil.getCurDateTime1()));
			array.add(baseInfodriver);
		}
		int result = TempHttpUtil.sendPost_JSON(url, array, "baseInfoDriver");
		if (200 == result||201==result) {
			System.out.println("第10条共推送"+pk+"条数据");
			System.out.println("发送 10.驾驶员基本信息成功!!!!!!!!!!!!!"+result);
		} else {
			System.out.println("发送10.驾驶员基本信息失败!!!!!!!!!!!!!"+result);
		}
	}


	/**
	 * 11.网约车驾驶员培训信息
	 * 
	 * @author txp
	 */
	@Override
	public void postBaseInfoDriverEducate() {

		String url = "/baseinfo/drivereducate";
		JSONArray array = new JSONArray();
		String companyId = Props.getValue("ecar.companyId");
		int address = 420107;
		// 总共二十一条数据
		String info = "420104197707182014#岗前培训#20171227#9:00:00#12:00:00,"	//1
				+ "420100198709101715#岗前培训#20171227#9:00:00#12:00:00,"	//2
				+ "420103197505254917#岗前培训#20171227#9:00:00#12:00:00,"//3
				+ "420102197410250618#岗前培训#20171227#9:00:00#12:00:00,"//4
				+ "420104198312282496#运营协调会#20171226#14:00:00#17:00:00,"//5
				+ "420703197705200019#运营协调会#20171226#14:00:00#17:00:00,"//6
				+ "420117198902163915#运营协调会#20171226#14:00:00#17:00:00,"//7
				+ "420923196910150630#运营协调会#20171226#14:00:00#17:00:00,"//8
				+ "420102197105014010#运营协调会#20171226#14:00:00#17:00:00,"//9
				+ "421122199004264219#运营协调会#20171226#14:00:00#17:00:00,"//10
				+ "420104196810213654#运营协调会#20171226#14:00:00#17:00:00,"//11
				+ "420104197003202419#运营协调会#20171226#14:00:00#17:00:00,"//12
				+ "420107197911060515#运营协调会#20171226#14:00:00#17:00:00,"//13
				+ "420103198609245315#运营协调会#20171226#14:00:00#17:00:00,"//14
				+ "420117198705095933#运营协调会#20171226#14:00:00#17:00:00,"//15
				+ "420102197104080614#运营协调会#20171226#14:00:00#17:00:00,"//16
				+ "420102198912031735#服务培训#20180115#9:00:00#12:00:00,"//17
				+ "420104197101261236#服务培训#20180115#9:00:00#12:00:00,"//18
				+ "420105196408150057#服务培训#20180115#9:00:00#12:00:00,"//19
				+ "420102197901053117#服务培训#20180115#9:00:00#12:00:00,"//20
				+ "420104197707182014#服务培训#20180115#9:00:00#12:00:00,"//21
				+ "420100198709101715#服务培训#20180115#9:00:00#12:00:00,"//22
				+ "420103197505254917#服务培训#20180115#9:00:00#12:00:00,"//23
				+ "420102197410250618#服务培训#20180115#9:00:00#12:00:00,"//24
				+ "420104198312282496#服务培训#20180115#9:00:00#12:00:00,"//25
				+ "420703197705200019#服务培训#20180115#9:00:00#12:00:00,"//26
				+ "420117198902163915#服务培训#20180115#9:00:00#12:00:00,"//27
				+ "420923196910150630#安全培训#20180117#14:00:00#17:00:00,"//28
				+ "421122199004264219#安全培训#20180117#14:00:00#17:00:00,"//29
				+ "420104196810213654#安全培训#20180117#14:00:00#17:00:00,"//30
				+ "420104197003202419#安全培训#20180117#14:00:00#17:00:00,"//31
				+ "420107197911060515#安全培训#20180117#14:00:00#17:00:00,"//32
				+ "420103198609245315#安全培训#20180117#14:00:00#17:00:00,"//33
				+ "420117198705095933#安全培训#20180117#14:00:00#17:00:00,"//34
				+ "420102197104080614#安全培训#20180117#14:00:00#17:00:00";//35
		String[] arr = info.split(",");
		int pk=0;
		for (int i = 0; i < 35; i++) {
			pk++;

			JSONObject baseInfoDriverEducate = new JSONObject();
			baseInfoDriverEducate.put("CompanyId", companyId);
			baseInfoDriverEducate.put("Address", address);
			baseInfoDriverEducate.put("LicenseId", arr[i].split("#")[0]);
			baseInfoDriverEducate.put("CourseName", arr[i].split("#")[1]);
			baseInfoDriverEducate.put("CourseDate", Long.parseLong(arr[i].split("#")[2]));
			baseInfoDriverEducate.put("StartTime", arr[i].split("#")[3]);
			baseInfoDriverEducate.put("StopTime", arr[i].split("#")[4]);
			baseInfoDriverEducate.put("Duration", 3);
			baseInfoDriverEducate.put("Flag", 1);
			baseInfoDriverEducate.put("UpdateTime",Long.parseLong(DateUtil.getCurDateTime1()));
			array.add(baseInfoDriverEducate);
		}
		int result = TempHttpUtil.sendPost_JSON(url, array, "baseInfoDriverEducate");
		if (200 == result||201==result) {
			System.out.println("第11条共推送"+pk+"条数据");
			System.out.println("发送11.网约车驾驶员培训信息成功!!!!!!!!!!!!!"+result);
		} else {
			System.out.println("发送 11.网约车驾驶员培训信息失败!!!!!!!!!!!!!"+result);
		}
	}

	/**
	 * 12.驾驶员移动终端信息
	 * 
	 * @author txp
	 */
	@Override
	public void postBaseInfoDriverApp() {

		String url = "/baseinfo/driverapp";
		JSONArray array = new JSONArray();
		String companyId = Props.getValue("ecar.companyId");
		int address = 420107;
		// 总共二十一条数据
		String info = "420104197707182014#15392948977,"
				+ "420100198709101715#13307193884,"
				+ "420103197505254917#13307196884,"
				+ "420102197410250618#13307194936,"
				+ "420923196910150630#15392889070,"
				+ "420102197104080614#18071040686,"
				+ "420703197705200019#13607230870,"
				+ "420102197105014010#17507121971,"
				+ "420105196408150057#15871387110,"
				+ "420102198912031735#15527607724,"
				+ "420104198312282496#18627171170,"
				+ "420103198609245315#13554688841,"
				+ "420104196810213654#18154404465,"
				+ "420104197101261236#15327285911,"
				+ "421122199004264219#15871826327,"
				+ "420107197911060515#13377898917,"
				+ "420117198902163915#13207180686,"
				+ "420117198705095933#13339997585,"
				+ "420104197003202419#15927004494,"
				+ "420102197901053117#13618602467";
		String[] arr = info.split(",");
		int pk=0;
		for (int i = 0; i < 20; i++) {
			pk++;

			JSONObject baseInfoVehicleTotalMile = new JSONObject();
			baseInfoVehicleTotalMile.put("CompanyId", companyId);
			baseInfoVehicleTotalMile.put("Address", address);
			baseInfoVehicleTotalMile.put("LicenseId", arr[i].split("#")[0]);
			baseInfoVehicleTotalMile.put("DriverPhone", arr[i].split("#")[1]);
			baseInfoVehicleTotalMile.put("NetType", 3);
			baseInfoVehicleTotalMile.put("AppVersion", "1.0.1");
			baseInfoVehicleTotalMile.put("MapType", 2);
			baseInfoVehicleTotalMile.put("State", 0);
			baseInfoVehicleTotalMile.put("Flag", 1);
			baseInfoVehicleTotalMile.put("UpdateTime", Long.parseLong(DateUtil.getCurDateTime1()));
			array.add(baseInfoVehicleTotalMile);
		}
		int result = TempHttpUtil.sendPost_JSON(url, array, "baseInfoDriverApp");
		if (200 == result||201==result) {
			System.out.println("第12条共推送"+pk+"条数据");
			System.out.println("发送12.驾驶员移动终端信息成功!!!!!!!!!!!!!"+result);
		} else {
			System.out.println("发送 12.驾驶员移动终端信息失败!!!!!!!!!!!!!"+result);
		}
	}

	/**
	 * 13.驾驶员统计信息
	 * 
	 * @author txp
	 */
	@Override
	public void postBaseInfoDriverStat() {

		String url = "/baseinfo/driverstat";
		JSONArray array = new JSONArray();
		String companyId = Props.getValue("ecar.companyId");
		int address = 420107;
		// 总共二十一条数据
		String info = "420104197707182014,"
				+ "420100198709101715,"
				+ "420103197505254917,"
				+ "420102197410250618,"
				+ "420923196910150630,"
				+ "420102197104080614,"
				+ "420703197705200019,"
				+ "420102197105014010,"
				+ "420105196408150057,"
				+ "420102198912031735,"
				+ "420104198312282496,"
				+ "420103198609245315,"
				+ "420104196810213654,"
				+ "420104197101261236,"
				+ "421122199004264219,"
				+ "420107197911060515,"
				+ "420117198902163915,"
				+ "420117198705095933,"
				+ "420104197003202419,"
				+ "420102197901053117";
		String[] arr = info.split(",");
		int pk=0;
		for (int i = 0; i < arr.length; i++) {
			pk++;

			JSONObject baseInfoDriverStat = new JSONObject();
			baseInfoDriverStat.put("CompanyId", companyId);
			baseInfoDriverStat.put("Address", address);
			baseInfoDriverStat.put("LicenseId", arr[i]);
			baseInfoDriverStat.put("Cycle", 201801);
			baseInfoDriverStat.put("OrderCount", 0);
			baseInfoDriverStat.put("TrafficViolationCount", 0);
			baseInfoDriverStat.put("ComplainedCount", 0);
			baseInfoDriverStat.put("Flag", 1);
			baseInfoDriverStat.put("UpdateTime", Long.parseLong(DateUtil.getCurDateTime1()));
			array.add(baseInfoDriverStat);
		}
		int result = TempHttpUtil.sendPost_JSON(url, array, "baseInfoDriverStat");
		if (200 == result||201==result) {
			System.out.println("第13条共推送"+pk+"条数据");
			System.out.println("发送13.驾驶员统计信息成功!!!!!!!!!!!!!"+result);
		} else {
			System.out.println("发送 13.驾驶员统计信息失败!!!!!!!!!!!!!"+result);
		}
	}

	/**
	 * 18.车辆经营上线
	 * 
	 * @author txp
	 */
	@Override
	public void postOperateLogin(Driver driver) {

		String url = "/operate/login";

		Map<String, Object> map = new HashMap<String, Object>();
		String companyId = Props.getValue("ecar.companyId");
		map.put("CompanyId", companyId);
		map.put("LicenseId", driver==null?"111111":driver.getLicenseId());
		String driverId = driver.getId();
		Car car = carMapper.selectByDriverId(driverId);

		map.put("VehicleNo", car.getNumberPlate());
		map.put("LoginTime", Long.parseLong(DateUtil.getCurDateTime1()));
		map.put("Encrypt", 0);

		int result = TempHttpUtil.sendPost_JSON(url,  map, "operateLogin");

		if (200 == result||201==result) {
			System.out.println("发送18.车辆经营上线成功!!!!!!!!!!!!!"+result);
		} else {
			System.out.println("发送18.车辆经营上线失败!!!!!!!!!!!!!"+result);
		}
	}


	/**
	 * 19.车辆经营下线
	 * 
	 * @author txp
	 */
	@Override
	public void postOperateLogOut(Driver driver) {
		String url = "/operate/logout";

		Map<String, Object> map = new HashMap<String, Object>();
		String companyId = Props.getValue("ecar.companyId");
		map.put("CompanyId", companyId);
		map.put("LicenseId", driver==null?"11111":driver.getLicenseId());
		String driverId = driver.getId();
		Car car = carMapper.selectByDriverId(driverId);
		map.put("VehicleNo", car.getNumberPlate());
		map.put("LogoutTime", Long.parseLong(DateUtil.getCurDateTime1()));
		map.put("Encrypt", 0);

		int result = TempHttpUtil.sendPost_JSON(url,  map, "operateLogout");

		if (200 == result||201==result) {
			System.out.println("发送19.车辆经营上线成功!!!!!!!!!!!!!"+result);
		} else {
			System.out.println("发送19.车辆经营上线失败!!!!!!!!!!!!!"+result);
		}

	}



}
